package com.cosina.game.robodefence.findway;

public class BlankRoute {
	
	final int sizeX,sizeY;
	public final Tile start, end;
	final int[][] routes;
	
	public BlankRoute(int sizeX, int sizeY,Tile start, Tile end){
		this.sizeX = sizeX;
		this.sizeY = sizeY;
		routes = new int[sizeY][sizeX];
		this.start = start;
		this.end = end;
	}
	
	public boolean isInPath(Tile someTile){
		return routes[someTile.y][someTile.x] != 0;
	}
	int index = 1;
	public boolean addRouteTile(Tile tile){
		this.routes[tile.y][tile.x] = index; 
		index ++;
		return true;
		
	}
	
	public boolean removeTile(Tile tile){
		index --;
		this.routes[tile.y][tile.x] = -1; 
		return true;
	}
	
	public Path getClear2Path(){
		return NeatWay.tranlate(routes);
	}
}
